#include "A.h"

#define eps 0.0001
#define M 1000

class Fun1 : public Fun
{
public:
	double f(double x)
	{
		return x - tan(x);
	}      
	double df(double x)
	{
		return -pow(tan(x),2);
	}
};

double test1()
{
	Fun1 f1;
	Newton s(f1, 4.5, eps, M);
	return s.solve();
}

double test2()
{
	Fun1 f1;
	Newton s(f1, 7.7, eps, M);
	return s.solve();
}


int main()
{
	printf("The solution of x-tanx near 4.5 is %f\n",test1());
    printf("The solution of x-tanx near 7.7 is %f\n",test2());
}